<?php
    $arr_pekerjaan = array();
    foreach($pekerjaan as $job){
        $arr_pekerjaan[$job->pekerjaan_id] = $job->pekerjaan_ket;
    }
?>
<table class="print table table-bordered table-striped">
    <thead>
        <tr >
            <th>No</th>
            <th>Nama Mandor</th>
            <th>Kode Vendor</th>
            <th>Badan Usaha</th>
            <th>Alamat</th>
            <th>NPWP</th>
            <th>Telp.</th>
            <th>Fax</th>
            <th>Email</th>
            <th>Pengalaman (Tahun)</th>
            <th>Kemampuan</th>
            <th>Wakil (Org)</th>
            <th>Tukang 1 (Org)</th>
            <th>Tukang 2 (Org)</th>
            <th>Pekerja (Org)</th>
            <th>Kota</th>
            <th>Status</th>
            <th>Keuangan</th>
            <th>Pendanaan</th>
        </tr>
    </thead>
    <tbody>
        
<?php
    $i = 0;
    foreach($data as $row){
        $i ++;
        
        $arr_kemampuan = explode(",",$row->mandor_kemampuan);
        $kemampuan = array();
        foreach($arr_kemampuan as $pekerjaan_id){
            $kemampuan[] =  @$arr_pekerjaan[$pekerjaan_id];
        }
       $kemampuan = implode(", <br />",$kemampuan);
        // record 
        echo "
        <tr>
            <td>$i</td>
            <td>$row->mandor_nama</td>
            <td>$row->mandor_kode</td>
            <td>$row->mandor_bu</td>
            <td>$row->mandor_alamat</td>
            <td>$row->mandor_npwp</td>
            <td>$row->mandor_telpon</td>
            <td>$row->mandor_fax</td>
            <td>$row->mandor_email</td>
            <td>$row->mandor_pengalaman Tahun</td>
            <td>$kemampuan</td>
            <td>$row->mandor_wakil</td>
            <td>$row->mandor_tukang1</td>
            <td>$row->mandor_tukang2</td>
            <td>$row->mandor_pekerja</td>
            <td>$row->mandor_kota</td>
            <td>$row->mandor_status</td>
            <td>$row->keuangan_ket</td>
            <td>$row->pendanaan_ket</td>
        </tr>
        ";
    }
?>
    </tbody>
</table>

        
